{
 "cells": [
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# Convert Tubes To Images: itk::Spatial Object bug Notebook"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "This notebook contains a few examples of how to call wrapped methods in itk and tubeTK ITK. The primary aim is to show a bug in TubeTK python wrapping for itk::SpatialObjects."
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "If ITK is not installed in your python environment, you need to define the environment variable `ITK_BUILD_DIR` that contains the path to where ITK was built."
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "We need to find the directory in which TubeTK was build. This is required to find the path to the testing data, and may be also required to find the TubeTK library paths if your python environment does not include it.\n",
    "The environment variable `TubeTK_BUILD_DIR` needs to be defined."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 6,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "import os\n",
    "import sys\n",
    "import numpy"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 7,
   "metadata": {
    "collapsed": false
   },
   "outputs": [],
   "source": [
    "# Path for TubeTK libs and bin\n",
    "#Values takend from TubeTK launcher\n",
    "\n",
    "sys.path.append(\"C:/src/TubeTK_Python_ITK/TubeTK-build/lib/\")\n",
    "sys.path.append(\"C:/src/TubeTK_Python_ITK/TubeTK-build/lib/Release\")"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 8,
   "metadata": {
    "collapsed": false,
    "scrolled": false
   },
   "outputs": [],
   "source": [
    "# Setting TubeTK Build Directory\n",
    "\n",
    "TubeTK_BUILD_DIR=None\n",
    "if 'TubeTK_BUILD_DIR' in os.environ:\n",
    "    TubeTK_BUILD_DIR = os.environ['TubeTK_BUILD_DIR']\n",
    "else:\n",
    "    print('TubeTK_BUILD_DIR not found!')\n",
    "    print('  Set environment variable')\n",
    "    os.environ[\"TubeTK_BUILD_DIR\"] = \"C:/src/TubeTK_Python_ITK/TubeTK-build\"\n",
    "    TubeTK_BUILD_DIR = os.environ[\"TubeTK_BUILD_DIR\"]\n",
    "    #sys.exit( 1 )\n",
    "    \n",
    "if not os.path.exists(TubeTK_BUILD_DIR):\n",
    "    print('TubeTK_BUILD_DIR set by directory not found!')\n",
    "    print('  TubeTK_BUILD_DIR = ' + TubeTK_BUILD_DIR )\n",
    "    sys.exit(1)\n",
    "    \n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 9,
   "metadata": {
    "collapsed": false
   },
   "outputs": [],
   "source": [
    "try:\n",
    "    import itk\n",
    "except:\n",
    "    ITK_BUILD_DIR = None\n",
    "    if 'ITK_BUILD_DIR' in os.environ:\n",
    "        ITK_BUILD_DIR = os.environ['ITK_BUILD_DIR']\n",
    "    else:\n",
    "        print('ITK_BUILD_DIR not found!')\n",
    "        print('  Set environment variable')\n",
    "        os.environ[\"ITK_BUILD_DIR\"] = \"C:/src/TubeTK_Python_R/ITK-build\"\n",
    "        ITK_BUILD_DIR = os.environ[\"ITK_BUILD_DIR\"]\n",
    "        #sys.exit( 1 )\n",
    "\n",
    "    if not os.path.exists(ITK_BUILD_DIR):\n",
    "        print('ITK_BUILD_DIR set by directory not found!')\n",
    "        print('  ITK_BUIDL_DIR = ' + ITK_BUILD_DIR )\n",
    "        sys.exit(1)\n",
    "    # Append ITK libs\n",
    "    sys.path.append(\"C:/src/TubeTK_Python_ITK/ITK-build/Wrapping/Generators/Python/Release\")\n",
    "    sys.path.append(\"C:/src/TubeTK_Python_ITK/ITK-build/lib/Release\")\n",
    "    sys.path.append(\"C:/src/TubeTK_Python_ITK/ITK-build/lib\")\n",
    "    \n",
    "    # Append TubeTK libs\n",
    "    sys.path.append(\"C:/src/TubeTK_Python_ITK/TubeTK-build/ITKModules/TubeTKITK-build/Wrapping/Generators/Python/Release\")\n",
    "    import itk"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 10,
   "metadata": {
    "collapsed": false
   },
   "outputs": [],
   "source": [
    "from itk import TubeTKITK as itktube\n"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "Initialization"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 11,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "Warning: Unknown parameter 'itk::QuadEdgeMeshCellTraitsInfo< 2,float,float,unsigned long,unsigned long,unsigned char,itk::QuadEdgeMeshPoint< float,2,itk::GeometricalQuadEdge< unsigned long, unsigned long,bool,bool,true > >,itk::MapContainer< unsigned long,itk::QuadEdgeMeshPoint< float,2,itk::GeometricalQuadEdge< unsigned long,unsigned long,bool,bool,true > > >,std::set< unsigned long >,itk::GeometricalQuadEdge< unsigned long,unsigned long,bool,bool,true > >' in template 'itk::CellInterface'\n",
      "Warning: Unknown parameter 'itk::QuadEdgeMeshCellTraitsInfo< 3,float,float,unsigned long,unsigned long,unsigned char,itk::QuadEdgeMeshPoint< float,3,itk::GeometricalQuadEdge< unsigned long, unsigned long,bool,bool,true > >,itk::MapContainer< unsigned long,itk::QuadEdgeMeshPoint< float,3,itk::GeometricalQuadEdge< unsigned long,unsigned long,bool,bool,true > > >,std::set< unsigned long >,itk::GeometricalQuadEdge< unsigned long,unsigned long,bool,bool,true > >' in template 'itk::CellInterface'\n"
     ]
    }
   ],
   "source": [
    "Dimension = 3\n",
    "PixelType = itk.UC\n",
    "\n",
    "sampleTubeFileName = os.path.join(TubeTK_BUILD_DIR, 'MIDAS_Data\\Branch-truth.tre')\n",
    "templateImageFileName = os.path.join(TubeTK_BUILD_DIR, 'MIDAS_Data\\Branch.n010.mha')\n",
    "outputImageFileName = os.path.join(TubeTK_BUILD_DIR, 'Temporary\\\\testOutput.mha')\n",
    "\n",
    "ImageType = itk.Image[PixelType, Dimension]\n",
    "SpatialObjectType = itk.SpatialObject[Dimension]"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "Reading the sample tube file and creating a sample spatial object group object"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 12,
   "metadata": {
    "collapsed": false
   },
   "outputs": [],
   "source": [
    "TubeFileReaderType = itk.SpatialObjectReader[Dimension]\n",
    "tubeFileReader = TubeFileReaderType.New()\n",
    "tubeFileReader.SetFileName(sampleTubeFileName)\n",
    "tubeFileReader.Update()\n",
    "\n",
    "sampleSpatialObjectGroup = tubeFileReader.GetGroup()"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "Reading the sample image file and creating an image object"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 14,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "\u001b[2000D\u001b[KitkImageFileReaderIUC3: 0.000000\u001b[2000D\u001b[KitkImageFileReaderIUC3: 1.000000\u001b[2000D\u001b[K"
     ]
    }
   ],
   "source": [
    "ImageReaderType = itk.ImageFileReader[ImageType]\n",
    "\n",
    "imageReader = ImageReaderType.New()\n",
    "imageReader.SetFileName(templateImageFileName)\n",
    "imageReader.Update()\n",
    "\n",
    "image = imageReader.GetOutput()"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "Testing ITK filter using itk spatial object. There are two such filters \n",
    "1. itkSpatialObjectToImageFilter  (Wrapped)\n",
    "2. itkSpatialObjectToPointSetFilter  (Not Wrapped)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 15,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "\u001b[2000D\u001b[KitkSpatialObjectToImageFilterSO3IUC3: 0.000000\u001b[2000D\u001b[KitkSpatialObjectToImageFilterSO3IUC3: 0.010000\u001b[2000D\u001b[KitkSpatialObjectToImageFilterSO3IUC3: 0.020000\u001b[2000D\u001b[KitkSpatialObjectToImageFilterSO3IUC3: 0.030000\u001b[2000D\u001b[KitkSpatialObjectToImageFilterSO3IUC3: 0.040000\u001b[2000D\u001b[KitkSpatialObjectToImageFilterSO3IUC3: 0.050000\u001b[2000D\u001b[KitkSpatialObjectToImageFilterSO3IUC3: 0.060000\u001b[2000D\u001b[KitkSpatialObjectToImageFilterSO3IUC3: 0.070000\u001b[2000D\u001b[KitkSpatialObjectToImageFilterSO3IUC3: 0.080000\u001b[2000D\u001b[KitkSpatialObjectToImageFilterSO3IUC3: 0.090000\u001b[2000D\u001b[KitkSpatialObjectToImageFilterSO3IUC3: 0.100000\u001b[2000D\u001b[KitkSpatialObjectToImageFilterSO3IUC3: 0.110000\u001b[2000D\u001b[KitkSpatialObjectToImageFilterSO3IUC3: 0.120000\u001b[2000D\u001b[KitkSpatialObjectToImageFilterSO3IUC3: 0.130000\u001b[2000D\u001b[KitkSpatialObjectToImageFilterSO3IUC3: 0.140000\u001b[2000D\u001b[KitkSpatialObjectToImageFilterSO3IUC3: 0.150000\u001b[2000D\u001b[KitkSpatialObjectToImageFilterSO3IUC3: 0.160000\u001b[2000D\u001b[KitkSpatialObjectToImageFilterSO3IUC3: 0.170000\u001b[2000D\u001b[KitkSpatialObjectToImageFilterSO3IUC3: 0.180000\u001b[2000D\u001b[KitkSpatialObjectToImageFilterSO3IUC3: 0.190000\u001b[2000D\u001b[KitkSpatialObjectToImageFilterSO3IUC3: 0.200000\u001b[2000D\u001b[KitkSpatialObjectToImageFilterSO3IUC3: 0.210000\u001b[2000D\u001b[KitkSpatialObjectToImageFilterSO3IUC3: 0.220000\u001b[2000D\u001b[KitkSpatialObjectToImageFilterSO3IUC3: 0.230000\u001b[2000D\u001b[KitkSpatialObjectToImageFilterSO3IUC3: 0.240000\u001b[2000D\u001b[KitkSpatialObjectToImageFilterSO3IUC3: 0.250000\u001b[2000D\u001b[KitkSpatialObjectToImageFilterSO3IUC3: 0.260000\u001b[2000D\u001b[KitkSpatialObjectToImageFilterSO3IUC3: 0.270000\u001b[2000D\u001b[KitkSpatialObjectToImageFilterSO3IUC3: 0.280000\u001b[2000D\u001b[KitkSpatialObjectToImageFilterSO3IUC3: 0.290000\u001b[2000D\u001b[KitkSpatialObjectToImageFilterSO3IUC3: 0.300000\u001b[2000D\u001b[KitkSpatialObjectToImageFilterSO3IUC3: 0.310000\u001b[2000D\u001b[KitkSpatialObjectToImageFilterSO3IUC3: 0.320000\u001b[2000D\u001b[KitkSpatialObjectToImageFilterSO3IUC3: 0.330000\u001b[2000D\u001b[KitkSpatialObjectToImageFilterSO3IUC3: 0.340000\u001b[2000D\u001b[KitkSpatialObjectToImageFilterSO3IUC3: 0.350000\u001b[2000D\u001b[KitkSpatialObjectToImageFilterSO3IUC3: 0.360000\u001b[2000D\u001b[KitkSpatialObjectToImageFilterSO3IUC3: 0.370000\u001b[2000D\u001b[KitkSpatialObjectToImageFilterSO3IUC3: 0.380000\u001b[2000D\u001b[KitkSpatialObjectToImageFilterSO3IUC3: 0.390000\u001b[2000D\u001b[KitkSpatialObjectToImageFilterSO3IUC3: 0.400000\u001b[2000D\u001b[KitkSpatialObjectToImageFilterSO3IUC3: 0.410000\u001b[2000D\u001b[KitkSpatialObjectToImageFilterSO3IUC3: 0.420000\u001b[2000D\u001b[KitkSpatialObjectToImageFilterSO3IUC3: 0.430000\u001b[2000D\u001b[KitkSpatialObjectToImageFilterSO3IUC3: 0.440000\u001b[2000D\u001b[KitkSpatialObjectToImageFilterSO3IUC3: 0.450000\u001b[2000D\u001b[KitkSpatialObjectToImageFilterSO3IUC3: 0.460000\u001b[2000D\u001b[KitkSpatialObjectToImageFilterSO3IUC3: 0.470000\u001b[2000D\u001b[KitkSpatialObjectToImageFilterSO3IUC3: 0.480000\u001b[2000D\u001b[KitkSpatialObjectToImageFilterSO3IUC3: 0.490000\u001b[2000D\u001b[KitkSpatialObjectToImageFilterSO3IUC3: 0.500000\u001b[2000D\u001b[KitkSpatialObjectToImageFilterSO3IUC3: 0.510000\u001b[2000D\u001b[KitkSpatialObjectToImageFilterSO3IUC3: 0.520000\u001b[2000D\u001b[KitkSpatialObjectToImageFilterSO3IUC3: 0.530000\u001b[2000D\u001b[KitkSpatialObjectToImageFilterSO3IUC3: 0.540000\u001b[2000D\u001b[KitkSpatialObjectToImageFilterSO3IUC3: 0.550000\u001b[2000D\u001b[KitkSpatialObjectToImageFilterSO3IUC3: 0.560000\u001b[2000D\u001b[KitkSpatialObjectToImageFilterSO3IUC3: 0.570000\u001b[2000D\u001b[KitkSpatialObjectToImageFilterSO3IUC3: 0.580000\u001b[2000D\u001b[KitkSpatialObjectToImageFilterSO3IUC3: 0.590000\u001b[2000D\u001b[KitkSpatialObjectToImageFilterSO3IUC3: 0.600000\u001b[2000D\u001b[KitkSpatialObjectToImageFilterSO3IUC3: 0.610000\u001b[2000D\u001b[KitkSpatialObjectToImageFilterSO3IUC3: 0.620000\u001b[2000D\u001b[KitkSpatialObjectToImageFilterSO3IUC3: 0.630000\u001b[2000D\u001b[KitkSpatialObjectToImageFilterSO3IUC3: 0.640000\u001b[2000D\u001b[KitkSpatialObjectToImageFilterSO3IUC3: 0.650000\u001b[2000D\u001b[KitkSpatialObjectToImageFilterSO3IUC3: 0.660000\u001b[2000D\u001b[KitkSpatialObjectToImageFilterSO3IUC3: 0.670000\u001b[2000D\u001b[KitkSpatialObjectToImageFilterSO3IUC3: 0.680000\u001b[2000D\u001b[KitkSpatialObjectToImageFilterSO3IUC3: 0.690000\u001b[2000D\u001b[KitkSpatialObjectToImageFilterSO3IUC3: 0.700000\u001b[2000D\u001b[KitkSpatialObjectToImageFilterSO3IUC3: 0.710000\u001b[2000D\u001b[KitkSpatialObjectToImageFilterSO3IUC3: 0.720000\u001b[2000D\u001b[KitkSpatialObjectToImageFilterSO3IUC3: 0.730000\u001b[2000D\u001b[KitkSpatialObjectToImageFilterSO3IUC3: 0.740000\u001b[2000D\u001b[KitkSpatialObjectToImageFilterSO3IUC3: 0.750000\u001b[2000D\u001b[KitkSpatialObjectToImageFilterSO3IUC3: 0.760000\u001b[2000D\u001b[KitkSpatialObjectToImageFilterSO3IUC3: 0.770000\u001b[2000D\u001b[KitkSpatialObjectToImageFilterSO3IUC3: 0.780000\u001b[2000D\u001b[KitkSpatialObjectToImageFilterSO3IUC3: 0.790000\u001b[2000D\u001b[KitkSpatialObjectToImageFilterSO3IUC3: 0.800000\u001b[2000D\u001b[KitkSpatialObjectToImageFilterSO3IUC3: 0.810000\u001b[2000D\u001b[KitkSpatialObjectToImageFilterSO3IUC3: 0.820000\u001b[2000D\u001b[KitkSpatialObjectToImageFilterSO3IUC3: 0.830000\u001b[2000D\u001b[KitkSpatialObjectToImageFilterSO3IUC3: 0.840000\u001b[2000D\u001b[KitkSpatialObjectToImageFilterSO3IUC3: 0.850000\u001b[2000D\u001b[KitkSpatialObjectToImageFilterSO3IUC3: 0.860000\u001b[2000D\u001b[KitkSpatialObjectToImageFilterSO3IUC3: 0.870000\u001b[2000D\u001b[KitkSpatialObjectToImageFilterSO3IUC3: 0.880000\u001b[2000D\u001b[KitkSpatialObjectToImageFilterSO3IUC3: 0.890000\u001b[2000D\u001b[KitkSpatialObjectToImageFilterSO3IUC3: 0.900000\u001b[2000D\u001b[KitkSpatialObjectToImageFilterSO3IUC3: 0.910000\u001b[2000D\u001b[KitkSpatialObjectToImageFilterSO3IUC3: 0.920000\u001b[2000D\u001b[KitkSpatialObjectToImageFilterSO3IUC3: 0.930000\u001b[2000D\u001b[KitkSpatialObjectToImageFilterSO3IUC3: 0.940000\u001b[2000D\u001b[KitkSpatialObjectToImageFilterSO3IUC3: 0.950000\u001b[2000D\u001b[KitkSpatialObjectToImageFilterSO3IUC3: 0.960000\u001b[2000D\u001b[KitkSpatialObjectToImageFilterSO3IUC3: 0.970000\u001b[2000D\u001b[KitkSpatialObjectToImageFilterSO3IUC3: 0.980000\u001b[2000D\u001b[KitkSpatialObjectToImageFilterSO3IUC3: 0.990000\u001b[2000D\u001b[KitkSpatialObjectToImageFilterSO3IUC3: 1.000000\u001b[2000D\u001b[KitkSpatialObjectToImageFilterSO3IUC3: 1.000000\u001b[2000D\u001b[K\u001b[2000D\u001b[KitkImageFileWriterIUC3: 0.000000\u001b[2000D\u001b[KitkImageFileWriterIUC3: 1.000000\u001b[2000D\u001b[K"
     ]
    }
   ],
   "source": [
    "# ITK Filter using ITK Spatial Object: OK\n",
    "\n",
    "s2iType = itk.SpatialObjectToImageFilter[SpatialObjectType, ImageType]\n",
    "s2i = s2iType.New()\n",
    "s2i.SetInput(sampleSpatialObjectGroup)\n",
    "s2i.Update()\n",
    "\n",
    "#Save the output image\n",
    "ImageWriterType = itk.ImageFileWriter[ImageType]\n",
    "imageWriter = ImageWriterType.New()\n",
    "imageWriter.SetInput(s2i.GetOutput())\n",
    "imageWriter.SetFileName(outputImageFileName)\n",
    "imageWriter.Update()\n"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "Testing TubeTK filter using itk Spatial Object"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 20,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "True\n"
     ]
    },
    {
     "ename": "TypeError",
     "evalue": "in method 'tubeConvertTubesToImage3UC_SetInput', argument 2 of type 'itk::SpatialObject< 3 > const *'",
     "output_type": "error",
     "traceback": [
      "\u001b[1;31m---------------------------------------------------------------------------\u001b[0m",
      "\u001b[1;31mTypeError\u001b[0m                                 Traceback (most recent call last)",
      "\u001b[1;32m<ipython-input-20-ee7af8ee8f8f>\u001b[0m in \u001b[0;36m<module>\u001b[1;34m()\u001b[0m\n\u001b[0;32m     11\u001b[0m \u001b[0mtubesToImageFilter\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0mSetTemplateImage\u001b[0m\u001b[1;33m(\u001b[0m\u001b[0mimage\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m     12\u001b[0m \u001b[1;31m#tubesToImageFilter.SetInput(sampleSpatialObjectGroup) # //Expected to work, but is not working\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[1;32m---> 13\u001b[1;33m \u001b[0mtubesToImageFilter\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0mSetInput\u001b[0m\u001b[1;33m(\u001b[0m\u001b[0mSpatialObject\u001b[0m\u001b[1;33m)\u001b[0m \u001b[1;31m# //Expected to work, but is not working\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0m\u001b[0;32m     14\u001b[0m \u001b[0mtubesToImageFilter\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0mUpdate\u001b[0m\u001b[1;33m(\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m     15\u001b[0m \u001b[1;33m\u001b[0m\u001b[0m\n",
      "\u001b[1;31mTypeError\u001b[0m: in method 'tubeConvertTubesToImage3UC_SetInput', argument 2 of type 'itk::SpatialObject< 3 > const *'"
     ]
    }
   ],
   "source": [
    "# TubeTK Filter using ITK Spatial Object: NOT OK\n",
    "SpatialObject = SpatialObjectType.New()\n",
    "\n",
    "#verify sampleSpatialObjectGroup\n",
    "print (isinstance(sampleSpatialObjectGroup, SpatialObjectType))\n",
    "\n",
    "TubesToImageFilterType = itktube.ConvertTubesToImage[Dimension, PixelType]\n",
    "\n",
    "tubesToImageFilter = TubesToImageFilterType.New()\n",
    "tubesToImageFilter.SetUseRadius(True)\n",
    "tubesToImageFilter.SetTemplateImage(image)\n",
    "#tubesToImageFilter.SetInput(sampleSpatialObjectGroup) # //Expected to work, but is not working\n",
    "tubesToImageFilter.SetInput(SpatialObject) # //Expected to work, but is not working\n",
    "tubesToImageFilter.Update()\n",
    "\n",
    "\n",
    "\n",
    "# Another TubeTK Filter\n",
    "\n",
    "FilterType = itktube.ComputeTubeFlyThroughImage[PixelType, Dimension]\n",
    "Filter = FilterType.New()\n",
    "Filter.SetInputImage(image)\n",
    "Filter.SetTubeId(0)\n",
    "Filter.SetInput(sampleSpatialObjectGroup) # //Expected to work, but is not working\n",
    "Filter.Update()\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 2",
   "language": "python",
   "name": "python2"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 2
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython2",
   "version": "2.7.10"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 0
}
